package demo;

import java.util.Scanner;

public class CCCCC {
    //评委打分
    public static void main(String[] args) {
        int[] scores=new int[6];
        Scanner sc=new Scanner(System.in);
        for (int i = 0; i < scores.length; i++) {
            System.out.println("请输入第"+(i+1)+"个评委的分数：");
            int score=sc.nextInt();//上面的scores是复数，这里的score是单数 赋给scores
            if(score<0||score>100)
            {
                System.out.println("请您重新输入（1~100）");
                int scoree=sc.nextInt();
                scores[i]=scoree;
            }
            else
            scores[i]=score;
        }
        int Max=scores[0];
        int Min=scores[0];
        int sum=0;
        for (int i = 0; i < scores.length; i++) {
             if(scores[i]>Max)
             {
                 Max=scores[i];
             }
            if(scores[i]<Min)
            {
                Min=scores[i];
            }
            sum+=scores[i];
        }
        double result=(sum-Max-Min)*1.0/(scores.length-2);
        System.out.println("平均分为："+result);
    }
}
